package one.stand.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import one.stand.model.FinanceModel;
import one.stand.model.ResultModel;
import one.stand.request.AdminRecordRequest;
import one.stand.request.FinanceRequest;
import one.stand.request.NoticeRequest;
import one.stand.response.NoticeResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author: ZRH
 * @CreateDate: 2019/5/29 9:45
 */
@RestController
@RequestMapping("adminApi/notice")
@Api(description = "企业公告管理")
public class NoticeController extends BaseController{

    @ApiOperation(value = "查询企业公告列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeTitle", value = "公告标题", paramType = "String"),
            @ApiImplicitParam(name = "noticeContent", value = "公告内容", paramType = "String"),
            @ApiImplicitParam(name = "noticeJumpType", value = "跳转类型，1绝对路径，2小程序路径", paramType = "Integer"),
            @ApiImplicitParam(name = "noticeType", value = "0全部,1,用端，2小程序端，", paramType = "Integer"),
    })
    @PostMapping("selectNoticeList")
    public ResultModel<Map<String, Object>> selectNoticeList(NoticeRequest request) {
        return adminFegin.selectNoticeList(request);
    }

    @ApiOperation(value = "查询企业公告信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType = "Integer"),
    })
    @PostMapping("getNoticeInfo")
    public ResultModel<NoticeResponse> getNoticeInfo(NoticeRequest request) {
        return adminFegin.getNoticeInfo(request);
    }

    @ApiOperation(value = "查询企业公告信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeId", value = "公告id", paramType = "Integer"),
            @ApiImplicitParam(name = "noticeTitle", value = "公告标题", required = true, paramType = "String"),
            @ApiImplicitParam(name = "noticeContent", value = "公告内容", required = true, paramType = "String"),
            @ApiImplicitParam(name = "noticeJumpType", value = "跳转类型，1绝对路径，2小程序路径", required = true, paramType = "Integer"),
            @ApiImplicitParam(name = "noticeJumpUrl", value = "跳转路径", required = true, paramType = "String"),
            @ApiImplicitParam(name = "noticeType", value = "0全部,1,用端，2小程序端，", required = true, paramType = "Integer"),
            @ApiImplicitParam(name = "endTimes", value = "开始时间", required = true, paramType = "String"),
            @ApiImplicitParam(name = "startTimes", value = "截止时间", required = true, paramType = "String"),
    })
    @PostMapping("insertNotice")
    public ResultModel<Boolean> insertNotice(NoticeRequest request) {
        return adminFegin.insertNotice(request);
    }

    @ApiOperation(value = "查询企业公告信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "noticeId", value = "公告id", required = true, paramType = "Integer"),
    })
    @PostMapping("delNotice")
    public ResultModel<Boolean> delNotice(NoticeRequest request) {
        return adminFegin.delNotice(request);
    }
}
